<?php

// Global variable for table object
$clientes = NULL;

//
// Table class for clientes
//
class cclientes extends cTable {
	var $id;
	var $Nombre;
	var $Apellido;
	var $Dni;
	var $Calle;
	var $Numero;
	var $Piso;
	var $Dpto;
	var $EntreCalles;
	var $TelCel;
	var $TelFijo;
	var $TelVecino;
	var $_Email;
	var $FechaNacimiento;
	var $Provincia;
	var $Localidad;
	var $CP;
	var $NivelMorosidad;
	var $LimiteCredito;
	var $LimiteContado;
	var $TipoCliente;
	var $Habilitacion;
	var $IngresoMensual;
	var $CodigoAutorizacionSMS;

	//
	// Table class constructor
	//
	function __construct() {
		global $Language;

		// Language object
		if (!isset($Language)) $Language = new cLanguage();
		$this->TableVar = 'clientes';
		$this->TableName = 'clientes';
		$this->TableType = 'TABLE';
		$this->ExportAll = TRUE;
		$this->ExportPageBreakCount = 0; // Page break per every n record (PDF only)
		$this->ExportPageOrientation = "portrait"; // Page orientation (PDF only)
		$this->ExportPageSize = "a4"; // Page size (PDF only)
		$this->DetailAdd = FALSE; // Allow detail add
		$this->DetailEdit = FALSE; // Allow detail edit
		$this->DetailView = FALSE; // Allow detail view
		$this->ShowMultipleDetails = FALSE; // Show multiple details
		$this->GridAddRowCount = 5;
		$this->AllowAddDeleteRow = ew_AllowAddDeleteRow(); // Allow add/delete row
		$this->UserIDAllowSecurity = 0; // User ID Allow
		$this->BasicSearch = new cBasicSearch($this->TableVar);

		// id
		$this->id = new cField('clientes', 'clientes', 'x_id', 'id', '`id`', '`id`', 3, -1, FALSE, '`id`', FALSE, FALSE, FALSE, 'FORMATTED TEXT');
		$this->id->FldDefaultErrMsg = $Language->Phrase("IncorrectInteger");
		$this->fields['id'] = &$this->id;

		// Nombre
		$this->Nombre = new cField('clientes', 'clientes', 'x_Nombre', 'Nombre', '`Nombre`', '`Nombre`', 200, -1, FALSE, '`Nombre`', FALSE, FALSE, FALSE, 'FORMATTED TEXT');
		$this->fields['Nombre'] = &$this->Nombre;

		// Apellido
		$this->Apellido = new cField('clientes', 'clientes', 'x_Apellido', 'Apellido', '`Apellido`', '`Apellido`', 200, -1, FALSE, '`Apellido`', FALSE, FALSE, FALSE, 'FORMATTED TEXT');
		$this->fields['Apellido'] = &$this->Apellido;

		// Dni
		$this->Dni = new cField('clientes', 'clientes', 'x_Dni', 'Dni', '`Dni`', '`Dni`', 200, -1, FALSE, '`Dni`', FALSE, FALSE, FALSE, 'FORMATTED TEXT');
		$this->fields['Dni'] = &$this->Dni;

		// Calle
		$this->Calle = new cField('clientes', 'clientes', 'x_Calle', 'Calle', '`Calle`', '`Calle`', 200, -1, FALSE, '`Calle`', FALSE, FALSE, FALSE, 'FORMATTED TEXT');
		$this->fields['Calle'] = &$this->Calle;

		// Numero
		$this->Numero = new cField('clientes', 'clientes', 'x_Numero', 'Numero', '`Numero`', '`Numero`', 200, -1, FALSE, '`Numero`', FALSE, FALSE, FALSE, 'FORMATTED TEXT');
		$this->fields['Numero'] = &$this->Numero;

		// Piso
		$this->Piso = new cField('clientes', 'clientes', 'x_Piso', 'Piso', '`Piso`', '`Piso`', 200, -1, FALSE, '`Piso`', FALSE, FALSE, FALSE, 'FORMATTED TEXT');
		$this->fields['Piso'] = &$this->Piso;

		// Dpto
		$this->Dpto = new cField('clientes', 'clientes', 'x_Dpto', 'Dpto', '`Dpto`', '`Dpto`', 200, -1, FALSE, '`Dpto`', FALSE, FALSE, FALSE, 'FORMATTED TEXT');
		$this->fields['Dpto'] = &$this->Dpto;

		// EntreCalles
		$this->EntreCalles = new cField('clientes', 'clientes', 'x_EntreCalles', 'EntreCalles', '`EntreCalles`', '`EntreCalles`', 200, -1, FALSE, '`EntreCalles`', FALSE, FALSE, FALSE, 'FORMATTED TEXT');
		$this->fields['EntreCalles'] = &$this->EntreCalles;

		// TelCel
		$this->TelCel = new cField('clientes', 'clientes', 'x_TelCel', 'TelCel', '`TelCel`', '`TelCel`', 200, -1, FALSE, '`TelCel`', FALSE, FALSE, FALSE, 'FORMATTED TEXT');
		$this->fields['TelCel'] = &$this->TelCel;

		// TelFijo
		$this->TelFijo = new cField('clientes', 'clientes', 'x_TelFijo', 'TelFijo', '`TelFijo`', '`TelFijo`', 200, -1, FALSE, '`TelFijo`', FALSE, FALSE, FALSE, 'FORMATTED TEXT');
		$this->fields['TelFijo'] = &$this->TelFijo;

		// TelVecino
		$this->TelVecino = new cField('clientes', 'clientes', 'x_TelVecino', 'TelVecino', '`TelVecino`', '`TelVecino`', 200, -1, FALSE, '`TelVecino`', FALSE, FALSE, FALSE, 'FORMATTED TEXT');
		$this->fields['TelVecino'] = &$this->TelVecino;

		// Email
		$this->_Email = new cField('clientes', 'clientes', 'x__Email', 'Email', '`Email`', '`Email`', 200, -1, FALSE, '`Email`', FALSE, FALSE, FALSE, 'FORMATTED TEXT');
		$this->fields['Email'] = &$this->_Email;

		// FechaNacimiento
		$this->FechaNacimiento = new cField('clientes', 'clientes', 'x_FechaNacimiento', 'FechaNacimiento', '`FechaNacimiento`', 'DATE_FORMAT(`FechaNacimiento`, \'%d/%m/%Y\')', 133, 7, FALSE, '`FechaNacimiento`', FALSE, FALSE, FALSE, 'FORMATTED TEXT');
		$this->FechaNacimiento->FldDefaultErrMsg = str_replace("%s", "/", $Language->Phrase("IncorrectDateDMY"));
		$this->fields['FechaNacimiento'] = &$this->FechaNacimiento;

		// Provincia
		$this->Provincia = new cField('clientes', 'clientes', 'x_Provincia', 'Provincia', '`Provincia`', '`Provincia`', 3, -1, FALSE, '`Provincia`', FALSE, FALSE, FALSE, 'FORMATTED TEXT');
		$this->Provincia->FldDefaultErrMsg = $Language->Phrase("IncorrectInteger");
		$this->fields['Provincia'] = &$this->Provincia;

		// Localidad
		$this->Localidad = new cField('clientes', 'clientes', 'x_Localidad', 'Localidad', '`Localidad`', '`Localidad`', 3, -1, FALSE, '`Localidad`', FALSE, FALSE, FALSE, 'FORMATTED TEXT');
		$this->Localidad->FldDefaultErrMsg = $Language->Phrase("IncorrectInteger");
		$this->fields['Localidad'] = &$this->Localidad;

		// CP
		$this->CP = new cField('clientes', 'clientes', 'x_CP', 'CP', '`CP`', '`CP`', 200, -1, FALSE, '`CP`', FALSE, FALSE, FALSE, 'FORMATTED TEXT');
		$this->fields['CP'] = &$this->CP;

		// NivelMorosidad
		$this->NivelMorosidad = new cField('clientes', 'clientes', 'x_NivelMorosidad', 'NivelMorosidad', '`NivelMorosidad`', '`NivelMorosidad`', 3, -1, FALSE, '`NivelMorosidad`', FALSE, FALSE, FALSE, 'FORMATTED TEXT');
		$this->NivelMorosidad->FldDefaultErrMsg = $Language->Phrase("IncorrectInteger");
		$this->fields['NivelMorosidad'] = &$this->NivelMorosidad;

		// LimiteCredito
		$this->LimiteCredito = new cField('clientes', 'clientes', 'x_LimiteCredito', 'LimiteCredito', '`LimiteCredito`', '`LimiteCredito`', 131, -1, FALSE, '`LimiteCredito`', FALSE, FALSE, FALSE, 'FORMATTED TEXT');
		$this->LimiteCredito->FldDefaultErrMsg = $Language->Phrase("IncorrectFloat");
		$this->fields['LimiteCredito'] = &$this->LimiteCredito;

		// LimiteContado
		$this->LimiteContado = new cField('clientes', 'clientes', 'x_LimiteContado', 'LimiteContado', '`LimiteContado`', '`LimiteContado`', 131, -1, FALSE, '`LimiteContado`', FALSE, FALSE, FALSE, 'FORMATTED TEXT');
		$this->LimiteContado->FldDefaultErrMsg = $Language->Phrase("IncorrectFloat");
		$this->fields['LimiteContado'] = &$this->LimiteContado;

		// TipoCliente
		$this->TipoCliente = new cField('clientes', 'clientes', 'x_TipoCliente', 'TipoCliente', '`TipoCliente`', '`TipoCliente`', 3, -1, FALSE, '`TipoCliente`', FALSE, FALSE, FALSE, 'FORMATTED TEXT');
		$this->TipoCliente->FldDefaultErrMsg = $Language->Phrase("IncorrectInteger");
		$this->fields['TipoCliente'] = &$this->TipoCliente;

		// Habilitacion
		$this->Habilitacion = new cField('clientes', 'clientes', 'x_Habilitacion', 'Habilitacion', '`Habilitacion`', '`Habilitacion`', 3, -1, FALSE, '`Habilitacion`', FALSE, FALSE, FALSE, 'FORMATTED TEXT');
		$this->Habilitacion->FldDefaultErrMsg = $Language->Phrase("IncorrectInteger");
		$this->fields['Habilitacion'] = &$this->Habilitacion;

		// IngresoMensual
		$this->IngresoMensual = new cField('clientes', 'clientes', 'x_IngresoMensual', 'IngresoMensual', '`IngresoMensual`', '`IngresoMensual`', 131, -1, FALSE, '`IngresoMensual`', FALSE, FALSE, FALSE, 'FORMATTED TEXT');
		$this->IngresoMensual->FldDefaultErrMsg = $Language->Phrase("IncorrectFloat");
		$this->fields['IngresoMensual'] = &$this->IngresoMensual;

		// CodigoAutorizacionSMS
		$this->CodigoAutorizacionSMS = new cField('clientes', 'clientes', 'x_CodigoAutorizacionSMS', 'CodigoAutorizacionSMS', '`CodigoAutorizacionSMS`', '`CodigoAutorizacionSMS`', 131, -1, FALSE, '`CodigoAutorizacionSMS`', FALSE, FALSE, FALSE, 'FORMATTED TEXT');
		$this->CodigoAutorizacionSMS->FldDefaultErrMsg = $Language->Phrase("IncorrectFloat");
		$this->fields['CodigoAutorizacionSMS'] = &$this->CodigoAutorizacionSMS;
	}

	// Single column sort
	function UpdateSort(&$ofld) {
		if ($this->CurrentOrder == $ofld->FldName) {
			$sSortField = $ofld->FldExpression;
			$sLastSort = $ofld->getSort();
			if ($this->CurrentOrderType == "ASC" || $this->CurrentOrderType == "DESC") {
				$sThisSort = $this->CurrentOrderType;
			} else {
				$sThisSort = ($sLastSort == "ASC") ? "DESC" : "ASC";
			}
			$ofld->setSort($sThisSort);
			$this->setSessionOrderBy($sSortField . " " . $sThisSort); // Save to Session
		} else {
			$ofld->setSort("");
		}
	}

	// Table level SQL
	function SqlFrom() { // From
		return "`clientes`";
	}

	function SqlSelect() { // Select
		return "SELECT * FROM " . $this->SqlFrom();
	}

	function SqlWhere() { // Where
		$sWhere = "";
		$this->TableFilter = "";
		ew_AddFilter($sWhere, $this->TableFilter);
		return $sWhere;
	}

	function SqlGroupBy() { // Group By
		return "";
	}

	function SqlHaving() { // Having
		return "";
	}

	function SqlOrderBy() { // Order By
		return "";
	}

	// Check if Anonymous User is allowed
	function AllowAnonymousUser() {
		switch (@$this->PageID) {
			case "add":
			case "register":
			case "addopt":
				return FALSE;
			case "edit":
			case "update":
			case "changepwd":
			case "forgotpwd":
				return FALSE;
			case "delete":
				return FALSE;
			case "view":
				return FALSE;
			case "search":
				return FALSE;
			default:
				return FALSE;
		}
	}

	// Apply User ID filters
	function ApplyUserIDFilters($sFilter) {
		return $sFilter;
	}

	// Check if User ID security allows view all
	function UserIDAllow($id = "") {
		$allow = EW_USER_ID_ALLOW;
		switch ($id) {
			case "add":
			case "copy":
			case "gridadd":
			case "register":
			case "addopt":
				return (($allow & 1) == 1);
			case "edit":
			case "gridedit":
			case "update":
			case "changepwd":
			case "forgotpwd":
				return (($allow & 4) == 4);
			case "delete":
				return (($allow & 2) == 2);
			case "view":
				return (($allow & 8) == 8);
			case "search":
				return (($allow & 8) == 8);
			default:
				return (($allow & 8) == 8);
		}
	}

	// Get SQL
	function GetSQL($where, $orderby) {
		return ew_BuildSelectSql($this->SqlSelect(), $this->SqlWhere(),
			$this->SqlGroupBy(), $this->SqlHaving(), $this->SqlOrderBy(),
			$where, $orderby);
	}

	// Table SQL
	function SQL() {
		$sFilter = $this->CurrentFilter;
		$sFilter = $this->ApplyUserIDFilters($sFilter);
		$sSort = $this->getSessionOrderBy();
		return ew_BuildSelectSql($this->SqlSelect(), $this->SqlWhere(),
			$this->SqlGroupBy(), $this->SqlHaving(), $this->SqlOrderBy(),
			$sFilter, $sSort);
	}

	// Table SQL with List page filter
	function SelectSQL() {
		$sFilter = $this->getSessionWhere();
		ew_AddFilter($sFilter, $this->CurrentFilter);
		$sFilter = $this->ApplyUserIDFilters($sFilter);
		$sSort = $this->getSessionOrderBy();
		return ew_BuildSelectSql($this->SqlSelect(), $this->SqlWhere(), $this->SqlGroupBy(),
			$this->SqlHaving(), $this->SqlOrderBy(), $sFilter, $sSort);
	}

	// Get ORDER BY clause
	function GetOrderBy() {
		$sSort = $this->getSessionOrderBy();
		return ew_BuildSelectSql("", "", "", "", $this->SqlOrderBy(), "", $sSort);
	}

	// Try to get record count
	function TryGetRecordCount($sSql) {
		global $conn;
		$cnt = -1;
		if ($this->TableType == 'TABLE' || $this->TableType == 'VIEW') {
			$sSql = "SELECT COUNT(*) FROM" . substr($sSql, 13);
			$sOrderBy = $this->GetOrderBy();
			if (substr($sSql, strlen($sOrderBy) * -1) == $sOrderBy)
				$sSql = substr($sSql, 0, strlen($sSql) - strlen($sOrderBy)); // Remove ORDER BY clause
		} else {
			$sSql = "SELECT COUNT(*) FROM (" . $sSql . ") EW_COUNT_TABLE";
		}
		if ($rs = $conn->Execute($sSql)) {
			if (!$rs->EOF && $rs->FieldCount() > 0) {
				$cnt = $rs->fields[0];
				$rs->Close();
			}
		}
		return intval($cnt);
	}

	// Get record count based on filter (for detail record count in master table pages)
	function LoadRecordCount($sFilter) {
		$origFilter = $this->CurrentFilter;
		$this->CurrentFilter = $sFilter;
		$this->Recordset_Selecting($this->CurrentFilter);

		//$sSql = $this->SQL();
		$sSql = $this->GetSQL($this->CurrentFilter, "");
		$cnt = $this->TryGetRecordCount($sSql);
		if ($cnt == -1) {
			if ($rs = $this->LoadRs($this->CurrentFilter)) {
				$cnt = $rs->RecordCount();
				$rs->Close();
			}
		}
		$this->CurrentFilter = $origFilter;
		return intval($cnt);
	}

	// Get record count (for current List page)
	function SelectRecordCount() {
		global $conn;
		$origFilter = $this->CurrentFilter;
		$this->Recordset_Selecting($this->CurrentFilter);
		$sSql = $this->SelectSQL();
		$cnt = $this->TryGetRecordCount($sSql);
		if ($cnt == -1) {
			if ($rs = $conn->Execute($sSql)) {
				$cnt = $rs->RecordCount();
				$rs->Close();
			}
		}
		$this->CurrentFilter = $origFilter;
		return intval($cnt);
	}

	// Update Table
	var $UpdateTable = "`clientes`";

	// INSERT statement
	function InsertSQL(&$rs) {
		global $conn;
		$names = "";
		$values = "";
		foreach ($rs as $name => $value) {
			if (!isset($this->fields[$name]))
				continue;
			$names .= $this->fields[$name]->FldExpression . ",";
			$values .= ew_QuotedValue($value, $this->fields[$name]->FldDataType) . ",";
		}
		while (substr($names, -1) == ",")
			$names = substr($names, 0, -1);
		while (substr($values, -1) == ",")
			$values = substr($values, 0, -1);
		return "INSERT INTO " . $this->UpdateTable . " ($names) VALUES ($values)";
	}

	// Insert
	function Insert(&$rs) {
		global $conn;
		return $conn->Execute($this->InsertSQL($rs));
	}

	// UPDATE statement
	function UpdateSQL(&$rs, $where = "") {
		$sql = "UPDATE " . $this->UpdateTable . " SET ";
		foreach ($rs as $name => $value) {
			if (!isset($this->fields[$name]))
				continue;
			$sql .= $this->fields[$name]->FldExpression . "=";
			$sql .= ew_QuotedValue($value, $this->fields[$name]->FldDataType) . ",";
		}
		while (substr($sql, -1) == ",")
			$sql = substr($sql, 0, -1);
		$filter = $this->CurrentFilter;
		ew_AddFilter($filter, $where);
		if ($filter <> "")	$sql .= " WHERE " . $filter;
		return $sql;
	}

	// Update
	function Update(&$rs, $where = "", $rsold = NULL) {
		global $conn;
		return $conn->Execute($this->UpdateSQL($rs, $where));
	}

	// DELETE statement
	function DeleteSQL(&$rs, $where = "") {
		$sql = "DELETE FROM " . $this->UpdateTable . " WHERE ";
		if ($rs) {
			if (array_key_exists('id', $rs))
				ew_AddFilter($where, ew_QuotedName('id') . '=' . ew_QuotedValue($rs['id'], $this->id->FldDataType));
		}
		$filter = $this->CurrentFilter;
		ew_AddFilter($filter, $where);
		if ($filter <> "")
			$sql .= $filter;
		else
			$sql .= "0=1"; // Avoid delete
		return $sql;
	}

	// Delete
	function Delete(&$rs, $where = "") {
		global $conn;
		return $conn->Execute($this->DeleteSQL($rs, $where));
	}

	// Key filter WHERE clause
	function SqlKeyFilter() {
		return "`id` = @id@";
	}

	// Key filter
	function KeyFilter() {
		$sKeyFilter = $this->SqlKeyFilter();
		if (!is_numeric($this->id->CurrentValue))
			$sKeyFilter = "0=1"; // Invalid key
		$sKeyFilter = str_replace("@id@", ew_AdjustSql($this->id->CurrentValue), $sKeyFilter); // Replace key value
		return $sKeyFilter;
	}

	// Return page URL
	function getReturnUrl() {
		$name = EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_RETURN_URL;

		// Get referer URL automatically
		if (ew_ServerVar("HTTP_REFERER") <> "" && ew_ReferPage() <> ew_CurrentPage() && ew_ReferPage() <> "login.php") // Referer not same page or login page
			$_SESSION[$name] = ew_ServerVar("HTTP_REFERER"); // Save to Session
		if (@$_SESSION[$name] <> "") {
			return $_SESSION[$name];
		} else {
			return "clienteslist.php";
		}
	}

	function setReturnUrl($v) {
		$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_RETURN_URL] = $v;
	}

	// List URL
	function GetListUrl() {
		return "clienteslist.php";
	}

	// View URL
	function GetViewUrl($parm = "") {
		if ($parm <> "")
			return $this->KeyUrl("clientesview.php", $this->UrlParm($parm));
		else
			return $this->KeyUrl("clientesview.php", $this->UrlParm(EW_TABLE_SHOW_DETAIL . "="));
	}

	// Add URL
	function GetAddUrl() {
		return "clientesadd.php";
	}

	// Edit URL
	function GetEditUrl($parm = "") {
		return $this->KeyUrl("clientesedit.php", $this->UrlParm($parm));
	}

	// Inline edit URL
	function GetInlineEditUrl() {
		return $this->KeyUrl(ew_CurrentPage(), $this->UrlParm("a=edit"));
	}

	// Copy URL
	function GetCopyUrl($parm = "") {
		return $this->KeyUrl("clientesadd.php", $this->UrlParm($parm));
	}

	// Inline copy URL
	function GetInlineCopyUrl() {
		return $this->KeyUrl(ew_CurrentPage(), $this->UrlParm("a=copy"));
	}

	// Delete URL
	function GetDeleteUrl() {
		return $this->KeyUrl("clientesdelete.php", $this->UrlParm());
	}

	// Add key value to URL
	function KeyUrl($url, $parm = "") {
		$sUrl = $url . "?";
		if ($parm <> "") $sUrl .= $parm . "&";
		if (!is_null($this->id->CurrentValue)) {
			$sUrl .= "id=" . urlencode($this->id->CurrentValue);
		} else {
			return "javascript:alert(ewLanguage.Phrase('InvalidRecord'));";
		}
		return $sUrl;
	}

	// Sort URL
	function SortUrl(&$fld) {
		if ($this->CurrentAction <> "" || $this->Export <> "" ||
			in_array($fld->FldType, array(128, 204, 205))) { // Unsortable data type
				return "";
		} elseif ($fld->Sortable) {
			$sUrlParm = $this->UrlParm("order=" . urlencode($fld->FldName) . "&amp;ordertype=" . $fld->ReverseSort());
			return ew_CurrentPage() . "?" . $sUrlParm;
		} else {
			return "";
		}
	}

	// Get record keys from $_POST/$_GET/$_SESSION
	function GetRecordKeys() {
		global $EW_COMPOSITE_KEY_SEPARATOR;
		$arKeys = array();
		$arKey = array();
		if (isset($_POST["key_m"])) {
			$arKeys = ew_StripSlashes($_POST["key_m"]);
			$cnt = count($arKeys);
		} elseif (isset($_GET["key_m"])) {
			$arKeys = ew_StripSlashes($_GET["key_m"]);
			$cnt = count($arKeys);
		} elseif (isset($_GET)) {
			$arKeys[] = @$_GET["id"]; // id

			//return $arKeys; // Do not return yet, so the values will also be checked by the following code
		}

		// Check keys
		$ar = array();
		foreach ($arKeys as $key) {
			if (!is_numeric($key))
				continue;
			$ar[] = $key;
		}
		return $ar;
	}

	// Get key filter
	function GetKeyFilter() {
		$arKeys = $this->GetRecordKeys();
		$sKeyFilter = "";
		foreach ($arKeys as $key) {
			if ($sKeyFilter <> "") $sKeyFilter .= " OR ";
			$this->id->CurrentValue = $key;
			$sKeyFilter .= "(" . $this->KeyFilter() . ")";
		}
		return $sKeyFilter;
	}

	// Load rows based on filter
	function &LoadRs($sFilter) {
		global $conn;

		// Set up filter (SQL WHERE clause) and get return SQL
		//$this->CurrentFilter = $sFilter;
		//$sSql = $this->SQL();

		$sSql = $this->GetSQL($sFilter, "");
		$rs = $conn->Execute($sSql);
		return $rs;
	}

	// Load row values from recordset
	function LoadListRowValues(&$rs) {
		$this->id->setDbValue($rs->fields('id'));
		$this->Nombre->setDbValue($rs->fields('Nombre'));
		$this->Apellido->setDbValue($rs->fields('Apellido'));
		$this->Dni->setDbValue($rs->fields('Dni'));
		$this->Calle->setDbValue($rs->fields('Calle'));
		$this->Numero->setDbValue($rs->fields('Numero'));
		$this->Piso->setDbValue($rs->fields('Piso'));
		$this->Dpto->setDbValue($rs->fields('Dpto'));
		$this->EntreCalles->setDbValue($rs->fields('EntreCalles'));
		$this->TelCel->setDbValue($rs->fields('TelCel'));
		$this->TelFijo->setDbValue($rs->fields('TelFijo'));
		$this->TelVecino->setDbValue($rs->fields('TelVecino'));
		$this->_Email->setDbValue($rs->fields('Email'));
		$this->FechaNacimiento->setDbValue($rs->fields('FechaNacimiento'));
		$this->Provincia->setDbValue($rs->fields('Provincia'));
		$this->Localidad->setDbValue($rs->fields('Localidad'));
		$this->CP->setDbValue($rs->fields('CP'));
		$this->NivelMorosidad->setDbValue($rs->fields('NivelMorosidad'));
		$this->LimiteCredito->setDbValue($rs->fields('LimiteCredito'));
		$this->LimiteContado->setDbValue($rs->fields('LimiteContado'));
		$this->TipoCliente->setDbValue($rs->fields('TipoCliente'));
		$this->Habilitacion->setDbValue($rs->fields('Habilitacion'));
		$this->IngresoMensual->setDbValue($rs->fields('IngresoMensual'));
		$this->CodigoAutorizacionSMS->setDbValue($rs->fields('CodigoAutorizacionSMS'));
	}

	// Render list row values
	function RenderListRow() {
		global $conn, $Security;

		// Call Row Rendering event
		$this->Row_Rendering();

   // Common render codes
		// id
		// Nombre
		// Apellido
		// Dni
		// Calle
		// Numero
		// Piso
		// Dpto
		// EntreCalles
		// TelCel
		// TelFijo
		// TelVecino
		// Email
		// FechaNacimiento
		// Provincia
		// Localidad
		// CP
		// NivelMorosidad
		// LimiteCredito
		// LimiteContado
		// TipoCliente
		// Habilitacion
		// IngresoMensual
		// CodigoAutorizacionSMS
		// id

		$this->id->ViewValue = $this->id->CurrentValue;
		$this->id->ViewCustomAttributes = "";

		// Nombre
		$this->Nombre->ViewValue = $this->Nombre->CurrentValue;
		$this->Nombre->ViewCustomAttributes = "";

		// Apellido
		$this->Apellido->ViewValue = $this->Apellido->CurrentValue;
		$this->Apellido->ViewCustomAttributes = "";

		// Dni
		$this->Dni->ViewValue = $this->Dni->CurrentValue;
		$this->Dni->ViewCustomAttributes = "";

		// Calle
		$this->Calle->ViewValue = $this->Calle->CurrentValue;
		$this->Calle->ViewCustomAttributes = "";

		// Numero
		$this->Numero->ViewValue = $this->Numero->CurrentValue;
		$this->Numero->ViewCustomAttributes = "";

		// Piso
		$this->Piso->ViewValue = $this->Piso->CurrentValue;
		$this->Piso->ViewCustomAttributes = "";

		// Dpto
		$this->Dpto->ViewValue = $this->Dpto->CurrentValue;
		$this->Dpto->ViewCustomAttributes = "";

		// EntreCalles
		$this->EntreCalles->ViewValue = $this->EntreCalles->CurrentValue;
		$this->EntreCalles->ViewCustomAttributes = "";

		// TelCel
		$this->TelCel->ViewValue = $this->TelCel->CurrentValue;
		$this->TelCel->ViewCustomAttributes = "";

		// TelFijo
		$this->TelFijo->ViewValue = $this->TelFijo->CurrentValue;
		$this->TelFijo->ViewCustomAttributes = "";

		// TelVecino
		$this->TelVecino->ViewValue = $this->TelVecino->CurrentValue;
		$this->TelVecino->ViewCustomAttributes = "";

		// Email
		$this->_Email->ViewValue = $this->_Email->CurrentValue;
		$this->_Email->ViewCustomAttributes = "";

		// FechaNacimiento
		$this->FechaNacimiento->ViewValue = $this->FechaNacimiento->CurrentValue;
		$this->FechaNacimiento->ViewValue = ew_FormatDateTime($this->FechaNacimiento->ViewValue, 7);
		$this->FechaNacimiento->ViewCustomAttributes = "";

		// Provincia
		if (strval($this->Provincia->CurrentValue) <> "") {
			$sFilterWrk = "`id`" . ew_SearchString("=", $this->Provincia->CurrentValue, EW_DATATYPE_NUMBER);
		$sSqlWrk = "SELECT `id`, `Nombre` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `provincia`";
		$sWhereWrk = "";
		if ($sFilterWrk <> "") {
			ew_AddFilter($sWhereWrk, $sFilterWrk);
		}

		// Call Lookup selecting
		$this->Lookup_Selecting($this->Provincia, $sWhereWrk);
		if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk;
			$rswrk = $conn->Execute($sSqlWrk);
			if ($rswrk && !$rswrk->EOF) { // Lookup values found
				$this->Provincia->ViewValue = $rswrk->fields('DispFld');
				$rswrk->Close();
			} else {
				$this->Provincia->ViewValue = $this->Provincia->CurrentValue;
			}
		} else {
			$this->Provincia->ViewValue = NULL;
		}
		$this->Provincia->ViewCustomAttributes = "";

		// Localidad
		if (strval($this->Localidad->CurrentValue) <> "") {
			$sFilterWrk = "`id`" . ew_SearchString("=", $this->Localidad->CurrentValue, EW_DATATYPE_NUMBER);
		$sSqlWrk = "SELECT `id`, `Nombre` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `localidades`";
		$sWhereWrk = "";
		if ($sFilterWrk <> "") {
			ew_AddFilter($sWhereWrk, $sFilterWrk);
		}

		// Call Lookup selecting
		$this->Lookup_Selecting($this->Localidad, $sWhereWrk);
		if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk;
			$rswrk = $conn->Execute($sSqlWrk);
			if ($rswrk && !$rswrk->EOF) { // Lookup values found
				$this->Localidad->ViewValue = $rswrk->fields('DispFld');
				$rswrk->Close();
			} else {
				$this->Localidad->ViewValue = $this->Localidad->CurrentValue;
			}
		} else {
			$this->Localidad->ViewValue = NULL;
		}
		$this->Localidad->ViewCustomAttributes = "";

		// CP
		$this->CP->ViewValue = $this->CP->CurrentValue;
		$this->CP->ViewCustomAttributes = "";

		// NivelMorosidad
		$this->NivelMorosidad->ViewValue = $this->NivelMorosidad->CurrentValue;
		$this->NivelMorosidad->ViewCustomAttributes = "";

		// LimiteCredito
		$this->LimiteCredito->ViewValue = $this->LimiteCredito->CurrentValue;
		$this->LimiteCredito->ViewCustomAttributes = "";

		// LimiteContado
		$this->LimiteContado->ViewValue = $this->LimiteContado->CurrentValue;
		$this->LimiteContado->ViewCustomAttributes = "";

		// TipoCliente
		$this->TipoCliente->ViewValue = $this->TipoCliente->CurrentValue;
		$this->TipoCliente->ViewCustomAttributes = "";

		// Habilitacion
		$this->Habilitacion->ViewValue = $this->Habilitacion->CurrentValue;
		$this->Habilitacion->ViewCustomAttributes = "";

		// IngresoMensual
		$this->IngresoMensual->ViewValue = $this->IngresoMensual->CurrentValue;
		$this->IngresoMensual->ViewCustomAttributes = "";

		// CodigoAutorizacionSMS
		$this->CodigoAutorizacionSMS->ViewValue = $this->CodigoAutorizacionSMS->CurrentValue;
		$this->CodigoAutorizacionSMS->ViewCustomAttributes = "";

		// id
		$this->id->LinkCustomAttributes = "";
		$this->id->HrefValue = "";
		$this->id->TooltipValue = "";

		// Nombre
		$this->Nombre->LinkCustomAttributes = "";
		$this->Nombre->HrefValue = "";
		$this->Nombre->TooltipValue = "";

		// Apellido
		$this->Apellido->LinkCustomAttributes = "";
		$this->Apellido->HrefValue = "";
		$this->Apellido->TooltipValue = "";

		// Dni
		$this->Dni->LinkCustomAttributes = "";
		$this->Dni->HrefValue = "";
		$this->Dni->TooltipValue = "";

		// Calle
		$this->Calle->LinkCustomAttributes = "";
		$this->Calle->HrefValue = "";
		$this->Calle->TooltipValue = "";

		// Numero
		$this->Numero->LinkCustomAttributes = "";
		$this->Numero->HrefValue = "";
		$this->Numero->TooltipValue = "";

		// Piso
		$this->Piso->LinkCustomAttributes = "";
		$this->Piso->HrefValue = "";
		$this->Piso->TooltipValue = "";

		// Dpto
		$this->Dpto->LinkCustomAttributes = "";
		$this->Dpto->HrefValue = "";
		$this->Dpto->TooltipValue = "";

		// EntreCalles
		$this->EntreCalles->LinkCustomAttributes = "";
		$this->EntreCalles->HrefValue = "";
		$this->EntreCalles->TooltipValue = "";

		// TelCel
		$this->TelCel->LinkCustomAttributes = "";
		$this->TelCel->HrefValue = "";
		$this->TelCel->TooltipValue = "";

		// TelFijo
		$this->TelFijo->LinkCustomAttributes = "";
		$this->TelFijo->HrefValue = "";
		$this->TelFijo->TooltipValue = "";

		// TelVecino
		$this->TelVecino->LinkCustomAttributes = "";
		$this->TelVecino->HrefValue = "";
		$this->TelVecino->TooltipValue = "";

		// Email
		$this->_Email->LinkCustomAttributes = "";
		$this->_Email->HrefValue = "";
		$this->_Email->TooltipValue = "";

		// FechaNacimiento
		$this->FechaNacimiento->LinkCustomAttributes = "";
		$this->FechaNacimiento->HrefValue = "";
		$this->FechaNacimiento->TooltipValue = "";

		// Provincia
		$this->Provincia->LinkCustomAttributes = "";
		$this->Provincia->HrefValue = "";
		$this->Provincia->TooltipValue = "";

		// Localidad
		$this->Localidad->LinkCustomAttributes = "";
		$this->Localidad->HrefValue = "";
		$this->Localidad->TooltipValue = "";

		// CP
		$this->CP->LinkCustomAttributes = "";
		$this->CP->HrefValue = "";
		$this->CP->TooltipValue = "";

		// NivelMorosidad
		$this->NivelMorosidad->LinkCustomAttributes = "";
		$this->NivelMorosidad->HrefValue = "";
		$this->NivelMorosidad->TooltipValue = "";

		// LimiteCredito
		$this->LimiteCredito->LinkCustomAttributes = "";
		$this->LimiteCredito->HrefValue = "";
		$this->LimiteCredito->TooltipValue = "";

		// LimiteContado
		$this->LimiteContado->LinkCustomAttributes = "";
		$this->LimiteContado->HrefValue = "";
		$this->LimiteContado->TooltipValue = "";

		// TipoCliente
		$this->TipoCliente->LinkCustomAttributes = "";
		$this->TipoCliente->HrefValue = "";
		$this->TipoCliente->TooltipValue = "";

		// Habilitacion
		$this->Habilitacion->LinkCustomAttributes = "";
		$this->Habilitacion->HrefValue = "";
		$this->Habilitacion->TooltipValue = "";

		// IngresoMensual
		$this->IngresoMensual->LinkCustomAttributes = "";
		$this->IngresoMensual->HrefValue = "";
		$this->IngresoMensual->TooltipValue = "";

		// CodigoAutorizacionSMS
		$this->CodigoAutorizacionSMS->LinkCustomAttributes = "";
		$this->CodigoAutorizacionSMS->HrefValue = "";
		$this->CodigoAutorizacionSMS->TooltipValue = "";

		// Call Row Rendered event
		$this->Row_Rendered();
	}

	// Aggregate list row values
	function AggregateListRowValues() {
	}

	// Aggregate list row (for rendering)
	function AggregateListRow() {
	}

	// Export data in HTML/CSV/Word/Excel/Email/PDF format
	function ExportDocument(&$Doc, &$Recordset, $StartRec, $StopRec, $ExportPageType = "") {
		if (!$Recordset || !$Doc)
			return;

		// Write header
		$Doc->ExportTableHeader();
		if ($Doc->Horizontal) { // Horizontal format, write header
			$Doc->BeginExportRow();
			if ($ExportPageType == "view") {
				if ($this->id->Exportable) $Doc->ExportCaption($this->id);
				if ($this->Nombre->Exportable) $Doc->ExportCaption($this->Nombre);
				if ($this->Apellido->Exportable) $Doc->ExportCaption($this->Apellido);
				if ($this->Dni->Exportable) $Doc->ExportCaption($this->Dni);
				if ($this->Calle->Exportable) $Doc->ExportCaption($this->Calle);
				if ($this->Numero->Exportable) $Doc->ExportCaption($this->Numero);
				if ($this->Piso->Exportable) $Doc->ExportCaption($this->Piso);
				if ($this->Dpto->Exportable) $Doc->ExportCaption($this->Dpto);
				if ($this->EntreCalles->Exportable) $Doc->ExportCaption($this->EntreCalles);
				if ($this->TelCel->Exportable) $Doc->ExportCaption($this->TelCel);
				if ($this->TelFijo->Exportable) $Doc->ExportCaption($this->TelFijo);
				if ($this->TelVecino->Exportable) $Doc->ExportCaption($this->TelVecino);
				if ($this->_Email->Exportable) $Doc->ExportCaption($this->_Email);
				if ($this->FechaNacimiento->Exportable) $Doc->ExportCaption($this->FechaNacimiento);
				if ($this->Provincia->Exportable) $Doc->ExportCaption($this->Provincia);
				if ($this->Localidad->Exportable) $Doc->ExportCaption($this->Localidad);
				if ($this->CP->Exportable) $Doc->ExportCaption($this->CP);
				if ($this->NivelMorosidad->Exportable) $Doc->ExportCaption($this->NivelMorosidad);
				if ($this->LimiteCredito->Exportable) $Doc->ExportCaption($this->LimiteCredito);
				if ($this->LimiteContado->Exportable) $Doc->ExportCaption($this->LimiteContado);
				if ($this->TipoCliente->Exportable) $Doc->ExportCaption($this->TipoCliente);
				if ($this->Habilitacion->Exportable) $Doc->ExportCaption($this->Habilitacion);
				if ($this->IngresoMensual->Exportable) $Doc->ExportCaption($this->IngresoMensual);
				if ($this->CodigoAutorizacionSMS->Exportable) $Doc->ExportCaption($this->CodigoAutorizacionSMS);
			} else {
				if ($this->id->Exportable) $Doc->ExportCaption($this->id);
				if ($this->Nombre->Exportable) $Doc->ExportCaption($this->Nombre);
				if ($this->Apellido->Exportable) $Doc->ExportCaption($this->Apellido);
				if ($this->Dni->Exportable) $Doc->ExportCaption($this->Dni);
				if ($this->Calle->Exportable) $Doc->ExportCaption($this->Calle);
				if ($this->Numero->Exportable) $Doc->ExportCaption($this->Numero);
				if ($this->Piso->Exportable) $Doc->ExportCaption($this->Piso);
				if ($this->Dpto->Exportable) $Doc->ExportCaption($this->Dpto);
				if ($this->EntreCalles->Exportable) $Doc->ExportCaption($this->EntreCalles);
				if ($this->TelCel->Exportable) $Doc->ExportCaption($this->TelCel);
				if ($this->TelFijo->Exportable) $Doc->ExportCaption($this->TelFijo);
				if ($this->TelVecino->Exportable) $Doc->ExportCaption($this->TelVecino);
				if ($this->_Email->Exportable) $Doc->ExportCaption($this->_Email);
				if ($this->FechaNacimiento->Exportable) $Doc->ExportCaption($this->FechaNacimiento);
				if ($this->Provincia->Exportable) $Doc->ExportCaption($this->Provincia);
				if ($this->Localidad->Exportable) $Doc->ExportCaption($this->Localidad);
				if ($this->CP->Exportable) $Doc->ExportCaption($this->CP);
				if ($this->NivelMorosidad->Exportable) $Doc->ExportCaption($this->NivelMorosidad);
				if ($this->LimiteCredito->Exportable) $Doc->ExportCaption($this->LimiteCredito);
				if ($this->LimiteContado->Exportable) $Doc->ExportCaption($this->LimiteContado);
				if ($this->TipoCliente->Exportable) $Doc->ExportCaption($this->TipoCliente);
				if ($this->Habilitacion->Exportable) $Doc->ExportCaption($this->Habilitacion);
				if ($this->IngresoMensual->Exportable) $Doc->ExportCaption($this->IngresoMensual);
				if ($this->CodigoAutorizacionSMS->Exportable) $Doc->ExportCaption($this->CodigoAutorizacionSMS);
			}
			$Doc->EndExportRow();
		}

		// Move to first record
		$RecCnt = $StartRec - 1;
		if (!$Recordset->EOF) {
			$Recordset->MoveFirst();
			if ($StartRec > 1)
				$Recordset->Move($StartRec - 1);
		}
		while (!$Recordset->EOF && $RecCnt < $StopRec) {
			$RecCnt++;
			if (intval($RecCnt) >= intval($StartRec)) {
				$RowCnt = intval($RecCnt) - intval($StartRec) + 1;

				// Page break
				if ($this->ExportPageBreakCount > 0) {
					if ($RowCnt > 1 && ($RowCnt - 1) % $this->ExportPageBreakCount == 0)
						$Doc->ExportPageBreak();
				}
				$this->LoadListRowValues($Recordset);

				// Render row
				$this->RowType = EW_ROWTYPE_VIEW; // Render view
				$this->ResetAttrs();
				$this->RenderListRow();
				$Doc->BeginExportRow($RowCnt); // Allow CSS styles if enabled
				if ($ExportPageType == "view") {
					if ($this->id->Exportable) $Doc->ExportField($this->id);
					if ($this->Nombre->Exportable) $Doc->ExportField($this->Nombre);
					if ($this->Apellido->Exportable) $Doc->ExportField($this->Apellido);
					if ($this->Dni->Exportable) $Doc->ExportField($this->Dni);
					if ($this->Calle->Exportable) $Doc->ExportField($this->Calle);
					if ($this->Numero->Exportable) $Doc->ExportField($this->Numero);
					if ($this->Piso->Exportable) $Doc->ExportField($this->Piso);
					if ($this->Dpto->Exportable) $Doc->ExportField($this->Dpto);
					if ($this->EntreCalles->Exportable) $Doc->ExportField($this->EntreCalles);
					if ($this->TelCel->Exportable) $Doc->ExportField($this->TelCel);
					if ($this->TelFijo->Exportable) $Doc->ExportField($this->TelFijo);
					if ($this->TelVecino->Exportable) $Doc->ExportField($this->TelVecino);
					if ($this->_Email->Exportable) $Doc->ExportField($this->_Email);
					if ($this->FechaNacimiento->Exportable) $Doc->ExportField($this->FechaNacimiento);
					if ($this->Provincia->Exportable) $Doc->ExportField($this->Provincia);
					if ($this->Localidad->Exportable) $Doc->ExportField($this->Localidad);
					if ($this->CP->Exportable) $Doc->ExportField($this->CP);
					if ($this->NivelMorosidad->Exportable) $Doc->ExportField($this->NivelMorosidad);
					if ($this->LimiteCredito->Exportable) $Doc->ExportField($this->LimiteCredito);
					if ($this->LimiteContado->Exportable) $Doc->ExportField($this->LimiteContado);
					if ($this->TipoCliente->Exportable) $Doc->ExportField($this->TipoCliente);
					if ($this->Habilitacion->Exportable) $Doc->ExportField($this->Habilitacion);
					if ($this->IngresoMensual->Exportable) $Doc->ExportField($this->IngresoMensual);
					if ($this->CodigoAutorizacionSMS->Exportable) $Doc->ExportField($this->CodigoAutorizacionSMS);
				} else {
					if ($this->id->Exportable) $Doc->ExportField($this->id);
					if ($this->Nombre->Exportable) $Doc->ExportField($this->Nombre);
					if ($this->Apellido->Exportable) $Doc->ExportField($this->Apellido);
					if ($this->Dni->Exportable) $Doc->ExportField($this->Dni);
					if ($this->Calle->Exportable) $Doc->ExportField($this->Calle);
					if ($this->Numero->Exportable) $Doc->ExportField($this->Numero);
					if ($this->Piso->Exportable) $Doc->ExportField($this->Piso);
					if ($this->Dpto->Exportable) $Doc->ExportField($this->Dpto);
					if ($this->EntreCalles->Exportable) $Doc->ExportField($this->EntreCalles);
					if ($this->TelCel->Exportable) $Doc->ExportField($this->TelCel);
					if ($this->TelFijo->Exportable) $Doc->ExportField($this->TelFijo);
					if ($this->TelVecino->Exportable) $Doc->ExportField($this->TelVecino);
					if ($this->_Email->Exportable) $Doc->ExportField($this->_Email);
					if ($this->FechaNacimiento->Exportable) $Doc->ExportField($this->FechaNacimiento);
					if ($this->Provincia->Exportable) $Doc->ExportField($this->Provincia);
					if ($this->Localidad->Exportable) $Doc->ExportField($this->Localidad);
					if ($this->CP->Exportable) $Doc->ExportField($this->CP);
					if ($this->NivelMorosidad->Exportable) $Doc->ExportField($this->NivelMorosidad);
					if ($this->LimiteCredito->Exportable) $Doc->ExportField($this->LimiteCredito);
					if ($this->LimiteContado->Exportable) $Doc->ExportField($this->LimiteContado);
					if ($this->TipoCliente->Exportable) $Doc->ExportField($this->TipoCliente);
					if ($this->Habilitacion->Exportable) $Doc->ExportField($this->Habilitacion);
					if ($this->IngresoMensual->Exportable) $Doc->ExportField($this->IngresoMensual);
					if ($this->CodigoAutorizacionSMS->Exportable) $Doc->ExportField($this->CodigoAutorizacionSMS);
				}
				$Doc->EndExportRow();
			}
			$Recordset->MoveNext();
		}
		$Doc->ExportTableFooter();
	}

	// Table level events
	// Recordset Selecting event
	function Recordset_Selecting(&$filter) {

		// Enter your code here	
	}

	// Recordset Selected event
	function Recordset_Selected(&$rs) {

		//echo "Recordset Selected";
	}

	// Recordset Search Validated event
	function Recordset_SearchValidated() {

		// Example:
		//$this->MyField1->AdvancedSearch->SearchValue = "your search criteria"; // Search value

	}

	// Recordset Searching event
	function Recordset_Searching(&$filter) {

		// Enter your code here	
	}

	// Row_Selecting event
	function Row_Selecting(&$filter) {

		// Enter your code here	
	}

	// Row Selected event
	function Row_Selected(&$rs) {

		//echo "Row Selected";
	}

	// Row Inserting event
	function Row_Inserting($rsold, &$rsnew) {

		// Enter your code here
		// To cancel, set return value to FALSE

		return TRUE;
	}

	// Row Inserted event
	function Row_Inserted($rsold, &$rsnew) {

		//echo "Row Inserted"
	}

	// Row Updating event
	function Row_Updating($rsold, &$rsnew) {

		// Enter your code here
		// To cancel, set return value to FALSE

		return TRUE;
	}

	// Row Updated event
	function Row_Updated($rsold, &$rsnew) {

		//echo "Row Updated";
	}

	// Row Update Conflict event
	function Row_UpdateConflict($rsold, &$rsnew) {

		// Enter your code here
		// To ignore conflict, set return value to FALSE

		return TRUE;
	}

	// Row Deleting event
	function Row_Deleting(&$rs) {

		// Enter your code here
		// To cancel, set return value to False

		return TRUE;
	}

	// Row Deleted event
	function Row_Deleted(&$rs) {

		//echo "Row Deleted";
	}

	// Email Sending event
	function Email_Sending(&$Email, &$Args) {

		//var_dump($Email); var_dump($Args); exit();
		return TRUE;
	}

	// Lookup Selecting event
	function Lookup_Selecting($fld, &$filter) {

		// Enter your code here
	}

	// Row Rendering event
	function Row_Rendering() {

		// Enter your code here	
	}

	// Row Rendered event
	function Row_Rendered() {

		// To view properties of field class, use:
		//var_dump($this-><FieldName>); 

	}

	// User ID Filtering event
	function UserID_Filtering(&$filter) {

		// Enter your code here
	}
}
?>
